package com.wzh.ojcodesandbox.factory;

import java.util.concurrent.ThreadFactory;

/**
 * @author wzh
 * @version 1.0
 * @data 2024/4/21 0:42
 */
public class MyThreadFactory implements ThreadFactory {

    private ThreadFactory threadFactory;

    public MyThreadFactory(ThreadFactory threadFactory){

    }
    @Override
    public Thread newThread(Runnable r) {
        Thread thread = threadFactory.newThread(r);
        thread.setUncaughtExceptionHandler(MyUncaughtExceptionHandler.getInstance());
        return thread;
    }
}
